/***
 * @常量路由
 */
export const Layout = () => import("@/views/Layout/index.vue")
export const constRouter = [
  {
    path: "/login",
    meta: { title: "登录", icon: "", isShow: false },
    component: () => import("@/views/Login/index.vue"),
  },
  {
    path: "/",
    redirect: "/home",
    name: "layout",
    meta: { title: "", icon: "", isShow: false },
    component: Layout,
    children: [
      {
        path: "/home",
        name: "home",
        meta: { title: "首页", icon: "HomeFilled", isShow: true },
        component: () => import("@/views/Home/index.vue"),
      },
    ],
  },
  {
    path: "/404",
    meta: { title: "404", isShow: false },
    component: () => import("@/views/404/index.vue"),
  },
]
/****
 * @异步路由也叫权限路由
 */
export const asyncRouter = [

  {
    path: "/canvas",
    name: "canvas",
    component: () => import("@/views/Canvas/index.vue"),
  },
  {
    path: "/components",
    name: "components",
    redirect: "/components/pagination",
    component: Layout,
  },
  {
    path: "/components/pagination",
    name: "pagination",
    component: () => import("@/views/Components/pagination/index.vue"),
  },
  {
    path: "/components/edit",
    name: "edit",
    component: () => import("@/views/Components/edit/index.vue"),
  },

  {
    path: "/moremenu",
    name: "moremenu",
    component: Layout,
    children: [
    ],
  },
  {
    path: "/moremenu/menu-one",
    name: "menu-one",
    component: () => import("@/views/MoreMenu/MenuOne/index.vue"),
  },
  {
    path: "/moremenu/menu-one/menu-two",
    name: "menu-two",
    component: () =>
      import("@/views/MoreMenu/MenuOne/MenuTwo/index.vue"),
  },
  {
    path: "/moremenu/menu-one/menu-two/menu-three-1",
    name: "menu-three-1",
    component: () =>
      import(
        "@/views/MoreMenu/MenuOne/MenuTwo/MenuThree/index-1.vue"
      ),
  },
  {
    path: "/moremenu/menu-one/menu-two/menu-three-2",
    name: "menu-three-2",
    component: () =>
      import(
        "@/views/MoreMenu/MenuOne/MenuTwo/MenuThree/index-2.vue"
      ),
  },

  // 系统管理
  {
    path: '/system',
    name: 'system',
    component: Layout,
  },
  {
    path: '/system/user',
    name: 'user',
    component: () => import('@/views/System/User/index.vue'),

  },
  {
    path: '/system/menu',
    name: 'menu',
    component: () => import('@/views/System/Menu/index.vue'),
  },
  {
    path: '/system/code-generator',
    name: 'code-generator',
    component: () => import('@/views/System/CodeGenerator/index.vue'),
  },
  {
    path: '/system/role',
    name: 'role',
    component: () => import('@/views/System/Role/index.vue'),
  },
  {
    path: '/system/dict',
    name: 'dict',
    component: () => import('@/views/System/Dict/index.vue'),
  }
]
/***
 * @任意路由
 */
export const anyRouter = [
  //任意路由
  {
    path: "/:pathMatch(.*)*",
    // name: 'Any',
    meta: { title: "任意路由", isShow: false },
    redirect: "/404",
  },
]
